#include <stdio.h>

void printNum(int A[],int n,int sum)
{
	int i=0;
	int j=n-1;
	while(i<j)
	{
		int tmp=A[i]+A[j];
		if(tmp==sum)
		{
			printf("%d %d\n",A[i],A[j]);
			return;
		}
		else if(tmp>sum)
		{
			j--;
		}
		else
		{
			i++;
		}
		
	}
}
int main()
{
	int A[]={1,3,5,6,7,9,13,16};
	printNum(A,8,11);
	return 0;
}
